package com.guo.hui.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.guo.hui.dao.ponal.CateDataMapper;
import com.guo.hui.dao.ponal.CateMapper;
import com.guo.hui.model.ponal.Cate;
import com.guo.hui.model.ponal.CateData;
import com.guo.hui.service.ResumeFrontService;

@Service("resumeFrontService")
public class ResumeFrontServiceImpl implements ResumeFrontService {

	@Autowired
	private CateMapper cateDao;
	@Autowired
	private CateDataMapper cateDataDao;

	public List<Cate> queryByMap(Map<String, Object> map) {
		List<Cate> list = cateDao.selectByMap(map);
		Map<String, Object> parm = new HashMap<String, Object>();
		for (Cate cate : list) {
			parm.put("userId", cate.getUserId());
			List<CateData> listdata = cateDataDao.selectByMap(parm);
			cate.setCateDatas(listdata);
		}
		return list;
	}

}
